package com.cmes.mes.basic.core.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cmes.core.annotation.Dict;
import com.cmes.mes.audit.entity.AuditModuleEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.List;

/**
 * 客户
 *
 * @author Bruce.Gong
 * @since 1.0.0-SNAPSHOT
 */
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_mes_customer")
public class CustomerEntity extends AuditModuleEntity {

    private String code;
    private String name;
    private Long pid;
    private String phone;
    private String fax;
    private String address;
    private String contact;
    private String email;
    /**
     * 统一社会信用代码
     */
    private String usci;
    /**
     * 开户行
     */
    private String bankName;
    /**
     * 银行账号
     */
    private String bankAccount;
    /**
     * 付款方式
     */
    @Dict(code = "customer_pay_type")
    private Integer payType;
    /**
     * 是否含税
     */
    private Boolean includeTax;
    private String remark;

    @TableField(exist = false)
    private List<CustomerEntity> children;

    @Override
    public String getSn() {
        return code;
    }

}
